package week3;

public class LightBulb {
	
	private boolean bulbState;
	private boolean bulbBroken;
	private int lifetime = 1000;
	
	public LightBulb(){
		this.bulbState = bulbState;
		this.bulbBroken = bulbBroken;
	}
	
	
	private boolean isBroken(){
			bulbBroken=true;
		return bulbBroken;
	}
	
	public boolean isState(){
		return bulbState;
	}
	
	public int getLifetime(){
		return lifetime;
	}
	
	
	public boolean changeState(){
		if (lifetime==0){
			isBroken();
			System.out.println("It is "+ bulbBroken +" that the bulb is now broken");
		}
		else{
			bulbState=!bulbState;
			lifetime = lifetime-1;
		
		}
		
		return bulbState;
	}
}

